package com.shoulei.designpattern.IteratorPattern;

/**
 * @ClassName:IteratorPatternDemo
 * @Descrition:
 * @Author:shoulei
 * @Date:2019/4/14 18:23
 * @Verson:
 */
public class IteratorPatternDemo {
    public static void main(String[] args) {
        NameRepository nameRepository = new NameRepository();
        for(Iterator iterator = nameRepository.getIterator();iterator.hasNext();){
            String name = (String)iterator.next();
            System.out.println("name:" + name);
        }

    }
}
